package com.homestead.utils;

import org.springframework.cglib.proxy.Enhancer;
import org.springframework.cglib.proxy.MethodInterceptor;

/**
 * @author yhb
 * @date 2021-03-12 21:32
 */
public class CglibUtil {
    public static <T> T createProxy(T targetObject, MethodInterceptor interceptor) {
        return (T) Enhancer.create(targetObject.getClass(), interceptor);

    }
}
